package com.ruoyi.cluster.domain;

import java.util.Date;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.ruoyi.agent.domain.KwMachineAgent;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.ruoyi.common.annotation.Excel;
import com.ruoyi.common.core.domain.BaseEntity;

/**
 * 基础信息——节点列对象 kw_cluster_node_info
 * 
 * @author gonianer
 * @date 2023-11-30
 */
public class KwClusterNodeInfo extends BaseEntity
{
    private static final long serialVersionUID = 1L;

    /** 自增键 */
    private Long id;

    /** 节点类型：mg、tg、cg、dg */
    @Excel(name = "节点类型：mg、tg、cg、dg")
    private String nodeType;

    /** 所属的大集群的编号 */
    @Excel(name = "所属的大集群的编号")
    private String hclusterId;

    /** 所属的子集群的kw_cluster_info.id */
    @Excel(name = "所属的子集群的kw_cluster_info.id")
    private Long clusterId;

    /** 所在机器的ip */
    @Excel(name = "所在机器的ip")
    private String hostIp;

    /** 服务端口 */
    @Excel(name = "服务端口")
    private Integer port;

    private String nodeRole;

    /** 内部服务端口 */
    @Excel(name = "内部服务端口")
    private Integer innerPort;

    /** 启动命令 */
    @Excel(name = "启动命令")
    private String cmdInfo;

    /** 该节点其他字段信息的json格式字符串 */
    @Excel(name = "该节点其他字段信息的json格式字符串")
    private String extraInfo;

    /** 上线时间 */
    @JsonFormat(pattern = "yyyy-MM-dd")
    @Excel(name = "上线时间", width = 30, dateFormat = "yyyy-MM-dd")
    private Date onlineTime;

    /** 最近在线时间 */
    @JsonFormat(pattern = "yyyy-MM-dd")
    @Excel(name = "最近在线时间", width = 30, dateFormat = "yyyy-MM-dd")
    private Date latestAliveTime;

    /** 添加人 */
    @Excel(name = "添加人")
    private String createUser;

    /** 修改人 */
    @Excel(name = "修改人")
    private String updateUser;

    /** 备注 */
    @Excel(name = "备注")
    private String comment;

    private KwMachineAgent agent;

    private int clusterInnerId;

    public void setId(Long id)
    {
        this.id = id;
    }

    public Long getId()
    {
        return id;
    }
    public void setNodeType(String nodeType) 
    {
        this.nodeType = nodeType;
    }

    public String getNodeType() 
    {
        return nodeType;
    }
    public void setHclusterId(String hclusterId) 
    {
        this.hclusterId = hclusterId;
    }

    public String getHclusterId() 
    {
        return hclusterId;
    }
    public void setClusterId(Long clusterId)
    {
        this.clusterId = clusterId;
    }

    public Long getClusterId()
    {
        return clusterId;
    }
    public void setHostIp(String hostIp) 
    {
        this.hostIp = hostIp;
    }

    public String getHostIp() 
    {
        return hostIp;
    }
    public void setPort(Integer port) 
    {
        this.port = port;
    }

    public Integer getPort() 
    {
        return port;
    }
    public void setInnerPort(Integer innerPort) 
    {
        this.innerPort = innerPort;
    }

    public Integer getInnerPort() 
    {
        return innerPort;
    }
    public void setCmdInfo(String cmdInfo) 
    {
        this.cmdInfo = cmdInfo;
    }

    public String getCmdInfo() 
    {
        return cmdInfo;
    }
    public void setExtraInfo(String extraInfo) 
    {
        this.extraInfo = extraInfo;
    }

    public String getExtraInfo() 
    {
        return extraInfo;
    }
    public void setOnlineTime(Date onlineTime) 
    {
        this.onlineTime = onlineTime;
    }

    public Date getOnlineTime() 
    {
        return onlineTime;
    }
    public void setLatestAliveTime(Date latestAliveTime) 
    {
        this.latestAliveTime = latestAliveTime;
    }

    public Date getLatestAliveTime() 
    {
        return latestAliveTime;
    }
    public void setCreateUser(String createUser) 
    {
        this.createUser = createUser;
    }

    public String getCreateUser() 
    {
        return createUser;
    }
    public void setUpdateUser(String updateUser) 
    {
        this.updateUser = updateUser;
    }

    public String getUpdateUser() 
    {
        return updateUser;
    }
    public void setComment(String comment) 
    {
        this.comment = comment;
    }

    public String getComment() 
    {
        return comment;
    }

    public KwMachineAgent getAgent() {
        return agent;
    }

    public void setAgent(KwMachineAgent agent) {
        this.agent = agent;
    }

    public int getClusterInnerId() {
        return clusterInnerId;
    }

    public void setClusterInnerId(int clusterInnerId) {
        this.clusterInnerId = clusterInnerId;
    }

    public String getNodeRole() {
        return nodeRole;
    }

    public void setNodeRole(String nodeRole) {
        this.nodeRole = nodeRole;
    }

    @Override
    public String toString() {
        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
            .append("id", getId())
            .append("nodeType", getNodeType())
            .append("hclusterId", getHclusterId())
            .append("clusterId", getClusterId())
            .append("hostIp", getHostIp())
            .append("port", getPort())
            .append("nodeRole", getNodeRole())
            .append("innerPort", getInnerPort())
            .append("cmdInfo", getCmdInfo())
            .append("extraInfo", getExtraInfo())
            .append("onlineTime", getOnlineTime())
            .append("latestAliveTime", getLatestAliveTime())
            .append("createTime", getCreateTime())
            .append("createUser", getCreateUser())
            .append("updateTime", getUpdateTime())
            .append("updateUser", getUpdateUser())
            .append("comment", getComment())
            .toString();
    }
}
